﻿@model OrchardHUN.Scripting.Models.ScriptPart

@using (Script.Foot())
{
    <script type="text/javascript">
        (function ($) {
            $(document).on("selectedEngineChanged.ScriptingExtensions", function (values) {
                if (values.engine != "PHP") return;

                values.editor.getSession().setMode({ path: "ace/mode/php", inline: true }); // Awesomeness by nightwing: https://github.com/ajaxorg/ace/issues/1142

                var sampleEditorSession = values.help.sample.getSession();
                sampleEditorSession.setMode({ path: "ace/mode/php", inline: true });
                sampleEditorSession.setValue("echo \"Hello PHP Scripting!\";");

                values.help.hint.text("@T("Enter a pure PHP expression without <?php and ?> tags.")");
            });
        })(jQuery);
    </script>
}